from ..database import database
from ..models.admin_user import AdminUser


class AdminUserService:
    @classmethod
    def create(cls, **kwargs):
        admin_user = AdminUser(**kwargs)
        database.session.add(admin_user)
        database.session.commit()
        return admin_user

    @classmethod
    def delete(cls, **kwargs):
        AdminUser.query.filter_by(**kwargs).delete()
        database.session.commit()
